import { defineUniPages } from '@uni-helper/vite-plugin-uni-pages'
import { tabBar } from './src/layouts/fg-tabbar/tabbarList'

export default defineUniPages({
  globalStyle: {
    navigationStyle: 'default',
    navigationBarTitleText: '绘本阅读',
    navigationBarBackgroundColor: '#f8f8f8',
    navigationBarTextStyle: 'black',
    backgroundColor: '#FFFFFF',
  },
  easycom: {
    autoscan: true,
    custom: {
      'uni-(.*)': '@dcloudio/uni-ui/lib/uni-$1/uni-$1.vue',
      '^fg-(.*)': '@/components/fg-$1/fg-$1.vue',
      '^wd-(.*)': 'wot-design-uni/components/wd-$1/wd-$1.vue',
    },
  },
  // tabbar 的配置统一在 “./src/layouts/fg-tabbar/tabbarList.ts” 文件中
  tabBar: tabBar as any,
  // 分包配置由页面文件的 <route> 块自动生成，这里不需要手动配置
  // subPackages 会根据 src/pages-sub 目录结构和页面文件的路由块自动生成
  // 预下载规则
  preloadRule: {
    'pages/index/index': {
      network: 'all',
      packages: ['pages-sub']
    },
    'pages/community/index': {
      network: 'all',
      packages: ['pages-sub']
    },
    'pages/study-checkin/index': {
      network: 'all',
      packages: ['pages-sub']
    },
    'pages/class/index': {
      network: 'all',
      packages: ['pages-sub']
    },
    'pages/my/index': {
      network: 'all',
      packages: ['pages-sub']
    }
  }
})
